<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/jsp/common/common.jsp"%>

<html>
<script language="javascript">
	function getRadioValue(arg){
		var objs = document.getElementsByName(arg);   
		for(var i=0;i<objs.length;i++) {  
		   if(objs[i].checked) {  
		 	  return objs[i].value; 
		   }  
		} 
		
		return ""; 
	}
	function chooseAttach(){
		var photoUrl = getRadioValue("rb_photo");
		window.location.href="<%=contextPath%>/onlineDraw/onlineDraw.jsp?photoUrl=" + photoUrl + "&kzkid=" + document.getElementById("kzkid").value;
	}
</script>
	<body>
			<s:hidden name="kzkid"/>
			<table width="100%" id="listtab">
				<tr>
					<th class="ct" width="10%" align="center" >选择</th>
					<th class="ct" width="60%">模板名称</th>
				</tr>
				<tr>
					<td class="ct">
						<input type="radio" name="rb_photo" value="N" />
					</td>
					<td class="lf">
						不使用模板
					</td>
				</tr>
				 <tbody id="mybody">
				<c:forEach items="${attachList}" var="file" varStatus="status">
					<tr id='tr${status.index}'>
						<td class="ct">
							<input type="radio" name="rb_photo" value="${file.url}" />
						</td>
						<td class="lf">
							<a href='<c:out value="${file.url}"/>' target="_blank"><c:out value="${file.filename}"/></a>
						</td>
					</tr>
				</c:forEach>
				</tbody>
				<tr>
					<td class="ct" colspan="3">
						<input type="button" value="确定" onclick="chooseAttach();" />
						<input type="button" value="关闭" onclick="window.close();" />
					</td>
				</tr>
			</table>
	</body>
</html>